import {http} from './request.js'
export const userAPI ={
    createUser:(data) => http.secure.post('/users',data),
    addPerson:(data) => http.secure.post('/persons',data),
    updateUserPassword:(data) => http.secure.post('/password',data),
    getActualUser:() => http.secure.get('/user'),
    register:(data) => http.public.post('/register',data),
    information:() => http.secure.get('/persons/current'),
    updateInformation:(data) => http.secure.put('/persons/current',data),
    getUsers:() => http.secure.get('/admin/users'),
    deleteUser:(id) => http.secure.delete(`/admin/users/${id}`),
    toggleUserActivation:(id, activated) => http.secure.put(`/admin/users/${id}/activation?activated=${activated}`),
    getTotalUsers:() => http.secure.get('/admin/stats/total-users'),
    getPendingApplications:() => http.secure.get('/admin/stats/pending-applications'),
    getTotalBusinesses:() => http.secure.get('/admin/stats/total-businesses'),
    getTotalOrders:() => http.secure.get('/admin/stats/total-orders')
}